package model

import daos.DummyCreator
import java.awt.Color
import org.uqbar.arena.layout.HorizontalLayout
import org.uqbar.arena.widgets.Button
import org.uqbar.arena.widgets.Label
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.MainWindow

class MainMenuView extends MainWindow<Partida>{
	
	new() {
		super(new Partida())
		new DummyCreator(this.modelObject)
	}

	
	override createContents(Panel mainPanel) {
		this.setTitle("¿Donde está Carmen Sandiego?")
		
		new Label(mainPanel) => [
			setText("¿Que haremos ahora, Detective?")
			setWidth(280)
		]
		
		val panelHorizontalButtons = new Panel(mainPanel).setLayout(new HorizontalLayout)
		
		new Button(panelHorizontalButtons) => [
			setCaption("Resolver Misterio")
			setBackground(Color ::LIGHT_GRAY)
			setWidth(120)

			onClick([| new InicioMisterioView(this , this.modelObject).open])
		]	
		
		new Button(panelHorizontalButtons) => [
			setCaption("Mapamundi")
			setBackground(Color ::LIGHT_GRAY)
			setWidth(120)
			onClick([| new MapamundiView(this, this.modelObject.mapamundi).open])
		]	
		
		new Button(panelHorizontalButtons) => [
			setCaption("Expedientes")
			setBackground(Color ::LIGHT_GRAY)
			setWidth(120)
			onClick([| new ExpedienteView(this, this.modelObject.bddVillano).open])
			
		]	
	}
	
	def static main(String[] args) {
		new MainMenuView().startApplication
	}
	
}